package com.example.intermingle.util;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author 绿松石
 * @version V1.0
 * @Title ThreadPoolUtils  线程池
 * @Description
 * @date 2021年08月23日 09:17
 * @since V1.0
 */
public class ThreadPoolUtils {

    private static final ThreadPoolExecutor exec = new ThreadPoolExecutor(200, 200,
            0L, TimeUnit.SECONDS,
            new LinkedBlockingQueue<Runnable>());

    /**
     * 禁止实例化
     */
    private ThreadPoolUtils() {

    }

    /**
     * 提交任务
     */
    public static void exec(Runnable task) {

        exec.submit(task);
    }
}
